<?php
class retrieve_banner_admin extends retrieve_base{

	private $module_display_options 	= array();
	
	/*************************************************************************************************************************
	* function produces abstract structure of modules db structure
	*
    * used to generate the table structure required abstract function that passes an abstract
	* representation of the desired table structure to the proper database module which will
	* interpet the abstract and convert it into a valid SQL Create table structure.
	*
	* @return Array list of abstract table definitions for this module
	*************************************************************************************************************************/
	function create_table(){
		$tables = array();
		/*************************************************************************************************************************
		* Table structure for table 'banner_list'
		*************************************************************************************************************************/
		$fields = array(
			array("bl_identifier"			,"unsigned integer"			,"NOT NULL"	,"default '0'" ,"key"),
			array("bl_client"				,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
			array("bl_label"				,"varchar(255)"				,"NOT NULL"	,"default ''"),
			array("bl_status"				,"unsigned integer"			,"NOT NULL"	,"default '0'"),
			array("bl_homepage_exception"	,"unsigned small integer"	,"NOT NULL"	,"default '0'"),
			array("bl_type"					,"unsigned integer"			,"NOT NULL"	,"default '0'"),
			array("bl_open_in_window"		,"unsigned small integer"	,"NOT NULL"	,"default '0'"), // 0 = No, 1 = Yes open in new window
			array("bl_direction"			,"unsigned small integer"	,"NOT NULL"	,"default '0'"), // 0 = horizontal, 1 = Vertical
			array("bl_number_to_display"	,"unsigned small integer"	,"NOT NULL"	,"default '1'") // number between 1 and 4 banners
		);
		$primary ="bl_identifier";
		$tables[count($tables)] = array("banner_list", $fields, $primary);
		
		/*************************************************************************************************************************
		* Table structure for table 'banner_log'
		*************************************************************************************************************************/
		$fields = array(
			array("bnrlog_day"		,"datetime"					,"NOT NULL"	,"default ''","key"),
			array("bnrlog_banner"	,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("bnrlog_client"	,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("bnrlog_pages"	,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("bnrlog_clicks"	,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("bnrlog_format"	,"unsigned small integer"	,"NOT NULL"	,"default '0'")
		);
		$primary ="";
		$tables[count($tables)] = array("banner_log", $fields, $primary);
		/*************************************************************************************************************************
		* Table structure for table 'banner_types'
		*************************************************************************************************************************/
		$fields = array(
			array("bt_identifier"		,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
	  		array("bt_client"			,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("bt_format"			,"unsigned integer"			,"NOT NULL"	,"default '0'"), // 0 = Image, 1 = flash, 2 = text
	  		array("bt_width"			,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("bt_height"			,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("bt_label"			,"varchar(255)"				,"NOT NULL"	,"default ''"),
	  		array("bt_description"		,"text"						,"NOT NULL"	,"default ''")
		);
		$primary ="bt_identifier";
		$tables[count($tables)] = array("banner_types", $fields, $primary);
		/*************************************************************************************************************************
		* Table structure for table 'banner_entry'
		*************************************************************************************************************************/
		$fields = array(
			array("be_identifier"			,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
	  		array("be_client"				,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
	  		array("be_label"				,"varchar(255)"				,"NOT NULL"	,"default ''"),
	  		array("be_status"				,"unsigned small integer"	,"NOT NULL"	,"default '0'","key"),
	  		array("be_url"					,"varchar(255)"				,"NOT NULL"	,"default ''"),
	  		array("be_type"					,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
//	  		array("be_file"					,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("be_max_page_impressions"	,"signed integer"			,"NOT NULL"	,"default '0'"),
	  		array("be_max_click_through"	,"signed integer"			,"NOT NULL"	,"default '0'"),
	  		array("be_cur_page_impressions"	,"unsigned integer"			,"NOT NULL"	,"default '0'"),
	  		array("be_cur_click_through"	,"unsigned integer"			,"NOT NULL"	,"default '0'"),
			array("be_date_starts"			,"datetime"					,"NOT NULL"	,"default ''"),
	  		array("be_date_expires"			,"datetime"					,"NOT NULL"	,"default ''"),
			array("be_txt_des1"				,"varchar(40)"				,"NOT NULL"	,"default ''"),
			array("be_txt_des2"				,"varchar(40)"				,"NOT NULL"	,"default ''"),
			array("be_txt_url"				,"varchar(40)"				,"NOT NULL"	,"default ''"),
			array("be_txt_label"			,"varchar(40)"				,"NOT NULL"	,"default ''"),
			array("be_random_toggle"		,"unsigned small integer"	,"NOT NULL"	,"default '0'","key")
		);
		$primary ="be_identifier";
		$tables[count($tables)] = array("banner_entry", $fields, $primary);
		/*************************************************************************************************************************
		* Table structure for table 'banner_entry_grouping'
		* many to many relationship table
		*************************************************************************************************************************/
		$fields = array(
			array("beg_banner"				,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
	  		array("beg_client"				,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
	  		array("beg_list"				,"unsigned integer"			,"NOT NULL"	,"default '0'","key"),
	  		array("beg_type"				,"unsigned integer"			,"NOT NULL"	,"default '0'","key")
		);
		$primary ="";
		$tables[count($tables)] = array("banner_entry_grouping", $fields, $primary);
		return $tables;
	}


}
?>